#ifndef PARESEEIT_H_
#define PARESERIT_H_

#define EIT_EVENT_MAX 128

#define EIT_PF_TABLE_ID 0x4e
#define EIT_SE_TABLE_ID 0x50
#define EIT__DESCRIPTOR_MAX 4096

typedef struct TS_EIT_INFO
{
    unsigned event_id                   :16;
    unsigned char start_time[5];
    unsigned duration                   :24;
    unsigned running_status             :3;
    unsigned freed_CA_mode              :1;
    unsigned descriptors_loop_length    :12;

    unsigned char descriptor[EIT__DESCRIPTOR_MAX];

}TS_EIT_INFO;




typedef struct TS_EIT
{
    unsigned table_id                       :8;
    unsigned section_syntax_indicator       :1;
    unsigned reserved_future_use            :1;
    unsigned reserved1                      :2;
    unsigned section_length                 :12;
    unsigned service_id                     :16;
    unsigned reserved2                      :2;
    unsigned version_number                 :5;
    unsigned current_next_indicator         :1;
    unsigned section_number                 :8;
    unsigned last_section_number            :8;
    unsigned transport_stream_id            :16;
    unsigned original_network_id            :16;
    unsigned segment_last_section_number    :8;
    unsigned last_table_id                  :8;

    TS_EIT_INFO astEIT_Info[EIT_EVENT_MAX];

    unsigned CRC_32                         :32;

    struct TS_EIT *next; 
	struct TS_EIT *Previous;
}TS_EIT;

TS_EIT *TS_PackageEitPoint;
TS_EIT *EitPoint;

#endif